import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '账户ID',
    align: "center",
    dataIndex: 'accountId'
  },
  {
    title: '会员ID',
    align: "center",
    dataIndex: 'memberId'
  },
  {
    title: '冻结余额',
    align: "center",
    dataIndex: 'balanceFrozen'
  },
  {
    title: '可提余额',
    align: "center",
    dataIndex: 'balanceWithdraw'
  },
  {
    title: '可用余额',
    align: "center",
    dataIndex: 'balance'
  },
  {
    title: '充值总额',
    align: "center",
    dataIndex: 'totalRecharge'
  },
  {
    title: '提现总额',
    align: "center",
    dataIndex: 'totalWithdraw'
  },
  {
    title: '消费总额',
    align: "center",
    dataIndex: 'totalConsume'
  },
  {
    title: '会员积分',
    align: "center",
    dataIndex: 'integral'
  },
  {
    title: '累计积分',
    align: "center",
    dataIndex: 'totalIntegral'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'remark'
  },
  {
    title: 'tenantId',
    align: "center",
    dataIndex: 'tenantId'
  },
  {
    title: '删除状态(0-正常,1-已删除)',
    align: "center",
    dataIndex: 'delFlag'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "会员ID",
    field: 'memberId',
    component: 'Input',
    colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '账户ID',
    field: 'accountId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入账户ID!'},
             ];
    },
  },
  {
    label: '会员ID',
    field: 'memberId',
    component: 'Input',
  },
  {
    label: '冻结余额',
    field: 'balanceFrozen',
    component: 'InputNumber',
  },
  {
    label: '可提余额',
    field: 'balanceWithdraw',
    component: 'InputNumber',
  },
  {
    label: '可用余额',
    field: 'balance',
    component: 'InputNumber',
  },
  {
    label: '充值总额',
    field: 'totalRecharge',
    component: 'InputNumber',
  },
  {
    label: '提现总额',
    field: 'totalWithdraw',
    component: 'InputNumber',
  },
  {
    label: '消费总额',
    field: 'totalConsume',
    component: 'InputNumber',
  },
  {
    label: '会员积分',
    field: 'integral',
    component: 'InputNumber',
  },
  {
    label: '累计积分',
    field: 'totalIntegral',
    component: 'InputNumber',
  },
  {
    label: '备注',
    field: 'remark',
    component: 'Input',
  },
  {
    label: 'tenantId',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '删除状态(0-正常,1-已删除)',
    field: 'delFlag',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
